479. Largest Palindrome Product
479. Largest Palindrome Product
Description
Solution
Because two n
-digits intergers’ product are range from 2n-1
digits to 2n
digits. Our strategy is constructing palindrome by str + reverse(str)
. Then we detect from highest n
-digits interger to sqrt(palin)
to see if it can be divided into 2 n
digits numbers.
Code
1 | class Solution: |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.